<link href="resources/framework/editormd-1.5.0/css/editormd.min.css" rel="stylesheet" type="text/css" />
<link href="resources/framework/wang-editor-3.1.1/wangEditor.min.css" rel="stylesheet" type="text/css" />
<div class="col-xs-12 p0 r0" ng-init="getArticleDetail(true)">
    <form method="post" ng-submit="submitForm('user/article/addOrUpdate.do',saveArticleCallBack, null, goBack);">
        <div class="col-xs-12 main-nav">
            <div class="btn-group btn-group-sm r3 fl mr10">
                <button class="btn btn-default" ng-click="goBack()" type="button">
                    <i class="iconfont mt-3">&#xe697;&nbsp;</i>返回
                </button>
            </div>

            <button type="submit" class="btn btn-adorn btn-sm">
                <i class="iconfont f12 mt-3">&#xe747; 快速保存</i>
            </button>
        </div>

        <div class="col-xs-12 p20 mt60">
            <div class="BGFFF p15">
                <table class="table table-no-border">
                    <tr>
                        <td class="w70 f14 fb C000">标题 <span class="adorn-color fb">*</span></td>
                        <td colspan="3">
                            <input class="form-control" type="text" ng-model="model.name" required>
                        </td>
                    </tr>

                    <tr>
                        <td class="f14 fb C000">类目
                            <span class="p0 f14 cursor mr20" onclick="tooltip('type-tip')" id="type-tip" data-toggle="tooltip" data-placement="right"
                                  title="「没有找到合适的类目？进入文档所在模块，点击编辑模块即可新增类目」">
					        <i class="iconfont adorn-color mt-3">&#xe6a3;</i>
				            </span>
                        </td>
                        <td>
                            <input class="form-control" type="text" id="category" ng-model="model.category"
                                   placeholder="点击选择类目" readonly
                                   ng-click="loadPick($event,220,250,'true','category','CATEGORY', '', model.category, '&key='+model.moduleId, 5);">
                        </td>

                        <td class="w70 fb C000">模块</td>
                        <td class="tl">
                            <input class="form-control cursor" type="text" id="moduleName" ng-model="model.moduleName"
                                   readonly autocomplete="off"
                                   ng-click="loadPickByName('iwidth=220|iheight=250|tagName=moduleName|tag=moduleId|code=MY_MODULE|def='+model.moduleId+'|params=&key='+model.projectId,$event)">
                        </td>
                    </tr>
                    <tr ng-if="showOperation('ARTICLE','');">
                        <td class="f14 fb C000">状态
                            <span class="p0 f14 cursor mr20" onclick="tooltip('status-tip')" id="status-tip" data-toggle="tooltip" data-placement="right"
                                  title="「推荐：将出现在首页推荐文档菜单下，站点页面：需要添加key，后端菜单将支持选着跳转至该站点页面（如果首页、联系页面等）」">
					        <i class="iconfont adorn-color mt-3">&#xe6a3;</i>
				            </span>
                        </td>
                        <td colspan="3">
                            <input class="form-control" type="text" id="statusName" placeholder="点击选择状态"
                                   ng-model="model.statusName" readonly
                                   ng-click="loadPickByName('iwidth=200|iheight=220|tagName=statusName|tag=status|code=ARTICLE_STATUS|def='+model.status,$event)">
                        </td>
                    </tr>

                    <tr ng-if="model.status == 100">
                        <td class="f14 fb C000">Key *</td>
                        <td class="tc" colspan="3">
                            <input class="form-control" type="text" ng-model="model.mkey"
                                   placeholder="页面唯一标识，不可重复，英文，如：HELP">
                        </td>
                    </tr>

                    <tr>
                        <td class="f14 fb C000">评论</td>
                        <td>
                            <select name="type" class="form-control" ng-model="model.canComment">
                                <option value="1" ng-selected="item.canComment==1">可评论</option>
                                <option value="0" ng-selected="item.canComment==0">不可评论</option>
                            </select>
                        </td>
                        <td class="f14 fb C000">排序</td>
                        <td class="tc">
                            <input class="form-control" min="0" type="number" ng-model="model.sequence">
                        </td>
                    </tr>

                    <tr>
                        <td class="tc f14 fb C000">简介</td>
                        <td class="tc" colspan="3">
                            <textarea class="form-control no-resize" rows="3" ng-model="model.brief"></textarea></td>
                    </tr>
                </table>
            </div>

            <div class="BGFFF p15 mt10" id="editor-div">
                <div class="col-xs-12 p15 mb10">
                    <div class="btn-group btn-group-sm r3 fl mr10">
                        <button type="button"
                                ng-class="{true: 'btn btn-main btn-sm article-editor', false: 'btn btn-btn-default btn-sm article-editor'}[model.useMarkdown == false]"
                                ng-click="model.useMarkdown = false">
                            <i class="iconfont f12 mt-3">&#xe69e; 富文本编辑器</i>
                        </button>
                        <button type="button"
                                ng-class="{true: 'btn btn-main btn-sm article-editor', false: 'btn btn-btn-default btn-sm article-editor'}[model.useMarkdown == true]"
                                ng-click="model.useMarkdown = true;createEditorMe()">
                            <i class="iconfont mt-3">&#xe8e6;&nbsp;</i>MarkDown编辑器
                        </button>
                    </div>

                    <div id="article-editor" ng-class="{true: 'mt50', false: 'mt50 none'}[model.useMarkdown == false]"></div>
                    <div id="markdown-editor" ng-class="{true: 'mt50', false: 'mt50 none'}[model.useMarkdown == true]">
                        <textarea style="display:none;"></textarea>
                    </div>
                </div>
                <div class="cb"></div>
            </div>
        </div>
    </form>

</div>
<div class="cb"></div>
<script src="resources/framework/editormd-1.5.0/editormd.min.js" charset="utf-8" ></script>
<script src="resources/framework/wang-editor-3.1.1/wangEditor.min.js" charset="utf-8" ></script>
